//
//  LKDownLoadManager.h
//  zlsn
//
//  Created by wangzheng on 2018/4/4.
//  Copyright © 2018年 Luculent. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "LKDownLoadModel.h"

@interface LKDownLoadManager : NSObject

@property (nonatomic, assign) NSInteger maxConcurrentCount;

+ (instancetype)sharedManager;

- (void)download:(NSURL *)URL
        filename:(NSString *)fileName
        filesize:(NSInteger)fileSize
           state:(void(^)(LKDownLoadState state))state
        progress:(void(^)(NSInteger receivedSize, NSInteger expectedSize, CGFloat progress))progress
      completion:(void(^)(BOOL isSuccess, NSString *filePath, NSError *error))completion;


- (BOOL)isDownloadCompletedOfFileName:(NSString *)fileName;

#pragma mark - Downloads
- (void)suspendDownloadOfFileName:(NSString *)fileName;
- (void)suspendAllDownloads;

- (void)resumeDownloadOfFileName:(NSString *)fileName;
- (void)resumeAllDownloads;

- (void)cancelDownloadOfFileName:(NSString *)fileName;
- (void)cancelAllDownloads;

#pragma mark - File
- (NSString *)fileFullPathOfFileName:(NSString *)fileName;
- (CGFloat)fileHasDownloadedProgressOfFileName:(NSString *)fileName;
- (void)deleteFile:(NSString *)fileName;
- (void)deleteAllFiles;

@end
